<template>
    <div>
        <el-card>
            <h3 class="title">详细信息
                <el-button size="mini" style="float: right;" type="success" icon="el-icon-download" @click="exportList">导出</el-button>
                <!-- <el-button size="mini" style="float: right; margin-right :10px" type="primary" icon="el-icon-s-check" >审核</el-button> -->
                <el-button size="mini" style="float: right;  margin-right :10px" type="info" icon="el-icon-back" @click="goBack">返回</el-button>
            </h3>
            <el-form label-width="140px">
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="清单名称：">
                            {{ detailData.parentName|| '-'}}<span v-if="detailData.parentName">{{detailData.isChangnei == 1 ? '-场内' :'-场外'}}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="清单总额：">
                            {{ detailData.childAmount|| '-'}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="结算总额：">
                            {{ detailData.settAmount|| '-'}}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="申请单位：">
                            {{ detailData.appName|| '-'}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="结算单位：">
                            {{ detailData.receName|| '-'}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="申请时间：">
                            {{ detailData.appTime|| '-'}}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="确认状态：">
                            {{ detailData.isConfirm ==1 ? '已确认' : '未确认'}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="确认时间：">
                            {{ detailData.confirmTime|| '-'}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="结算状态：">
                            {{ detailData.isSett==1 ? '已结算' : '未结算'}}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="结算时间：">
                            {{ detailData.settTime|| '-'}}
                        </el-form-item>
                    </el-col>
                        <el-col :span="8">
                        <el-form-item label="开票状态：">
                            {{ detailData.isInvoice ==1 ? '已开票' : '未开票'}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="开票时间：">
                            {{ detailData.invoiceTime|| '-'}}
                        </el-form-item>
                    </el-col>
           
                </el-row>
            </el-form>
            <h3 style="padding-bottom:10px">订单列表</h3>
            <common-table :tablList="tableData" :settItem="detailData">   </common-table>

        </el-card>

    </div>
</template>

<script>
import commonTable from '../../components/common_table.vue'
export default {
    components: {commonTable},
    props: {},
    data(){
        return{
            detailData:{},
            tableData:[],
        }
    },
    computed: {
        rowguid:function(){
            return this.getQuery('rowguid')
        }  
    },
    watch:{
        
    },
    methods: {
        getDetail:function(){
            this.$get(this.$store.getters.settUrl + '/settItemChild/'+ this.rowguid, {}, function(data) {
                this.detailData = data.settItemChild;
                this.tableData = data.guaOrderList;
            })
        },
        //导出
        exportList:function(){
            if(this.tableData.length !=0){
                var search = toSearch({
                    isExport: true,
                    token:this.getQuery('token') ? this.getQuery('token') : this.getGetters('user').token
                });
                window.open('/bhtong/settmg/settItemChild/' + this.rowguid + search);
            }else{
                ShowMsg('当前清单暂无数据，暂不支持导出', 'warning');
            }
        },
        goBack:function(){
            this.$router.go(-1)
        }
      
    },
    mounted:function(){
        this.getDetail();   
    }
}
</script>

<style scoped lang="scss">
    .title{
        padding-bottom: 10px;
        border-bottom: 1px solid #e8e8e8
    }
    ::v-deep .el-table th > .cell {
        text-align: center;
    }
    // ::v-deep .el-table .cell {
    //     text-align: center;
    // }
</style>

